Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build): Prevent redundant typechecking #5115

Merged
merged 1 commit into from
May 17, 2022

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented May 17, 2022

When the tsconfig optionskipLibCheck is false (as it is by default), TS typechecks not only your code, and not only the code you use from dependencies, but the entire codebase of all of your dependencies. Not only does this seem like overkill, in our case it's actually largely redundant, because our packages have very few dependencies other than each other. Turning this off speeds up the build and prevents us from, for example, typechecking the entire utils package 15 times (once for its own sake, and once for every one of the 14 packages which depend on it).

@github-actions
Copy link
Contributor

github-actions bot commented May 17, 2022

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 18.75 KB (-6.91% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 58.19 KB (-9.95% 🔽)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 17.49 KB (-7.25% 🔽)
@sentry/browser - ES6 CDN Bundle (minified) 52.43 KB (-9.56% 🔽)
@sentry/browser - Webpack (gzipped + minified) 19.33 KB (-16.84% 🔽)
@sentry/browser - Webpack (minified) 61.44 KB (-24.82% 🔽)
@sentry/react - Webpack (gzipped + minified) 19.35 KB (-16.88% 🔽)
@sentry/nextjs Client - Webpack (gzipped + minified) 42.81 KB (-10.92% 🔽)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 24.41 KB (-6.39% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 22.96 KB (-6.24% 🔽)

@lobsterkatie lobsterkatie force-pushed the kmclb-enable-skipLibCheck branch from 0b5a1e0 to 33c6304 Compare May 17, 2022 07:39
@lobsterkatie lobsterkatie marked this pull request as ready for review May 17, 2022 07:57
@lobsterkatie lobsterkatie requested review from lforst and Lms24 May 17, 2022 07:57
@lobsterkatie lobsterkatie merged commit 95db446 into 7.x May 17, 2022
@lobsterkatie lobsterkatie deleted the kmclb-enable-skipLibCheck branch May 17, 2022 13:07
AbhiPrasad pushed a commit that referenced this pull request May 30, 2022
When the tsconfig option`skipLibCheck`[1] is false (as it is by default), TS typechecks not only your code, and not only the code you use from dependencies, but the entire codebase of all of your dependencies. Not only does this seem like overkill, in our case it's actually largely redundant, because our packages have very few dependencies other than each other. Turning this off speeds up the build and prevents us from, for example, typechecking the entire `utils` package 15 times (once for its own sake, and once for every one of the 14 packages which depend on it). 

[1] https://www.typescriptlang.org/tsconfig#skipLibCheck
@AbhiPrasad AbhiPrasad added this to the 7.0.0 milestone May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants